<div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.html">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">片库管理</span></div>
        </div>
        <div class="search-wrap">
           
            <div class="search-content">
                
                    <table class="search-tab">
                        <tr>
                           <!-- <td>&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-primary btn2" style="background:#FF9999;" href="{:U('Pianku/index')}">公共片库</a></td>-->
                            <td><a class="btn btn-primary btn2" href="{:U('Ziyuan/my')}">私人片库</a></td>
							 
                        </tr>
                    </table>
                
          
        </div>

		   
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
						    
                            <th>影片id</th>
							<th>详情[点击看详细]</th>
							
                            <th>操作</th>
                        </tr>
                        <foreach name="re" item="v">
                        <tr>
						    

                           <td>{$v.id}</td>
						   <TD>
						   	   <a onclick="datu({$v.id})" style="cursor:pointer;">
								{$v.title}
							   </a>
						  
						   </TD>
						 
						   <td>
						     
						      <a onclick="jiaru({$v.id})" style="cursor:pointer;">生成链接</a>
							
						   </td>
                        </tr>
						</foreach>
                    </table>
                    <div class="list-page"> {$page}</div>
                </div>
            </form>
        </div>
    </div>
	<script>
	  
	  function jiaru(i){
	  
	   
	   layer.msg('正在生成链接', {
		  icon: 16
		  ,shade: 0.01,
		  time:20000
		});
	  
	    $.post("{:U('Pianku/add')}",{"id":i},function(re){
		  
		  
		  layer.closeAll();
		  
		  if(re==1){
		  
		    layer.alert('加入成功',function(){
			
			  location.reload();
			
			});
		  
		  }else{
		  
		    layer.msg('加入我的片库失败。', {icon: 5});
		  
		  }
		
		
		})
	  
	  }
	  
	    function datu(i){
			  layer.open({
				  type: 2,
				  title: '视频详情',
				  shadeClose: true,
				  shade: 0.8,
				  area: ['80%', '90%'],
				  content: '{:U("Pianku/big")}?id='+i //iframe的url
				}); 
			}
	
	</script>
	